#include "tests.h"

#include <stdio.h>
#include <sys/times.h>
#include <time.h>
#include <unistd.h>

static clock_t st_time;
static clock_t en_time;
static struct tms st_cpu;
static struct tms en_cpu;

static float
tics_to_seconds(clock_t tics)
{
	return tics/(float)sysconf(_SC_CLK_TCK);
}
void
start_clock()
{
	//st_time = times(&st_cpu);
	st_time = clock();;
}
void
end_clock()
{
	//en_time = times(&en_cpu);
	en_time = clock();
	printf("Temps ecoule: %f\n\n", ((double) en_time - st_time)/CLOCKS_PER_SEC );
	/*
	printf("Real Time: %.2f, User Time %.2f, System Time %.2f\n\n\n\n",
			tics_to_seconds(en_time - st_time),
			tics_to_seconds(en_cpu.tms_utime - st_cpu.tms_utime),
			tics_to_seconds(en_cpu.tms_stime - st_cpu.tms_stime));

	*/
}

